/**
 * 
 */
package br.edu.catolica.sadbc.entity.enums;

/**
 * @author robert.resende
 * 
 */
public enum TipoUsuario {

	ADMINISTRADOR(1, "Administrador"), 
	COORDENADOR(2, "Coordenador"), 
	PROFESSOR(3, "Professor"), 
	AVALIADOR(4, "Avaliador");

	private Integer value;
	private String description;

	private TipoUsuario(Integer value, String description) {
		this.value = value;
		this.description = description;
	}

	public Integer getValue() {
		return this.value;
	}

	public String getDescription() {
		return this.description;
	}

	public static String getEnumDescription(Integer value) {
		for (TipoUsuario currentEnum : values()) {
			if (currentEnum.getValue().equals(value)) {
				return currentEnum.getDescription();
			}
		}
		return null;
	}

	public static TipoUsuario find(Integer value) {
		for (TipoUsuario currentEnum : values()) {
			if (currentEnum.getValue().equals(value)) {
				return currentEnum;
			}
		}
		return null;
	}

	public static TipoUsuario find(String roleName) {
		for (TipoUsuario currentEnum : values()) {
			if (currentEnum.getValue().equals(roleName)) {
				return currentEnum;
			}
		}
		return null;
	}

}
